
package edu.tongji.jiaowu.dao.jdbc;
 
import java.util.List;

import edu.tongji.jiaowu.dao.EvScopeDao;
import com.tongji.quickCRUDQ.define.Row;
import com.tongji.quickCRUDQ.model.CommonBean;
import com.tongji.quickCRUDQ.dao.jdbc.BaseDaoJdbc;

public class EvScopeDaoJdbc extends BaseDaoJdbc implements EvScopeDao {
	String tableName="T_EV_SCOPE";
	String beanName="evScope";
	
	public CommonBean createEvScope(){
		CommonBean evScopes=this.createBean(tableName,beanName);
                return evScopes;		
	}
	
/*
	public CommonBean findEvScopes(String refid) {
		CommonBean evScopes=this.createEvScope();
		String sql="select * from T_EV_SCOPE where refid=?";
		List data=this.getCommonDao().select(sql,new String[]{refid});
		evScopes.addData(data);
                return evScopes;
       }
*/
	public CommonBean findEvScopeById(String id) {
		CommonBean evScopes=this.createEvScope();
		String sql="select * from T_EV_SCOPE where id=?";
		List data=this.getCommonDao().select(sql,new String[]{id});
		evScopes.addData(data);
    return evScopes;
  }
  
	public CommonBean findAllEvScopes() {
		CommonBean evScopes=this.createEvScope();
		String sql="select * from T_EV_SCOPE ";
		List data=this.getCommonDao().select(sql,new String[]{});
		evScopes.addData(data);
    return evScopes;
  }
	public void insertEvScope(CommonBean evScopeBean){
		List data=evScopeBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchInsert(row,data,this.getIdGenerator());
	}
	public void updateEvScope(CommonBean evScopeBean){
		List data=evScopeBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchUpdate(row,data);
	}
}

